//
//  YellowView.swift
//  swift-test
//
//  Created by 梁森 on 2021/5/7.
//  Copyright © 2021 apple. All rights reserved.
//

import UIKit

class YellowView: UIView {

	override init(frame: CGRect) {
		super.init(frame: frame)
		self.backgroundColor = .yellow
		addSubview(view)
	}
	
	lazy var view: UIView = {
		let view = UIView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
		view.backgroundColor = .blue
		return view
	}()
	
	required init?(coder: NSCoder) {
		fatalError("init(coder:) has not been implemented")
	}
	
	override func layoutSubviews() {
		super.layoutSubviews()
		print("🐯\(#function) in \(type(of: self))")
	}
	
	override func layoutIfNeeded() {
		super.layoutIfNeeded()
		print("🐘\(#function) in \(type(of: self))")
	}
}
